﻿<%@ Page Title="Gallery" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master"
    CodeBehind="Gallery.aspx.vb" Inherits="VW_Passat_Community.Gallery" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .addNewImage
        {
            height: 395px;
        }
        .step4
        {
            height: 248px;
        }
        .style3
        {
            width: 114px;
            height: 58px;
        }
        .style4
        {
            height: 58px;
            width: 336px;
        }
        .style5
        {
            height: 32px;
        }
        .step4a
        {
            width: 499px;
        }
        .step4b
        {
            width: 407px;
            height: 215px;
        }
        .tags
        {
            height: 105px;
        }
        .style8
        {
            height: 5px;
            width: 336px;
        }
        .style9
        {
            height: 5px;
        }
        .newTags
        {
            height: 104px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="bluecontent">
        <h1 class="headline3">
            Volkswagen Gallery
        </h1>
        <br />
        Welcome!&nbsp; to the Volkswagen Gallery. Here you will find all the images 
        uploaded by our users. Just scroll down to the amazing gallery.<br />
        <br />
        Why not get involved and upload a picture of your Volkswagen Passat to get commented
        on as it may convince you to add extra few bits onto your precious ride to get it
        kitted out and gain some popularity by our users.<br />
        <br />
    </div>
    <div class="addNewImage">
        <h3>
            Add a New Image</h3>
        <div>
            To add an image to the gallery below, please follow these simple steps:</div>
        <div class="step123">
            1. Browser and Locate your image file on your computer by clicking on the browse
            button below, click on your file and press submit.<br />
            <br />
            2. Fill in the description of the image.<br />
            <br />
            3. Once you&#39;ve done this, simply click on &#39;Submit&#39; and your image will
            be displayed on the thumbnail list <strong>below</strong>.<br />
            <br />
            <div class="step4">
                <div class="step4a">
                    <table align="center" style="height: 194px; width: 487px">
                        <tr>
                            <td align="left" class="style9" style="font-weight: bold" valign="middle">
                                Browse Picture
                            </td>
                            <td class="style8">
                                <asp:FileUpload ID="txtImage" runat="server" CssClass="textboxnormal" Width="314px" />
                            </td>
                        </tr>
                        <tr>
                            <td align="left" class="style3" style="font-weight: bold" valign="top">
                                Description
                            </td>
                            <td class="style4">
                                <asp:TextBox ID="txtimagedescription" runat="server" Font-Names="Calibri" ForeColor="Black"
                                    Height="66px" TextMode="MultiLine" Width="317px" CssClass="textboxnormal"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" class="style5" colspan="2" style="font-weight: bold">
                                <asp:Button ID="btnsubmit" runat="server" Text="Submit" CssClass="buttons" Height="31px" />
                                &nbsp;
                                <asp:Button ID="btnclear" runat="server" Text="Clear" CssClass="buttons" Height="31px" />
                            </td>
                        </tr>
                    </table>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtImage"
                        ErrorMessage="You have not selected an image, please check and try again." Font-Bold="True"
                        Font-Italic="True" ForeColor="Red"></asp:RequiredFieldValidator>
                </div>
            </div>
        </div>
    </div>
    &nbsp;&nbsp;
    <br />
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" GroupItemCount="3">
        <AlternatingItemTemplate>
            <td id="Td1" runat="server" style="">
                <strong><a href="imageAddComments.aspx?id=<%# Eval("ImageID") %>"></a></strong><a
                    href="imageAddComments.aspx?id=<%# Eval("ImageID") %>">
                    <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>'
                        Width="300px" />
                </a>
                <br />
                </a><strong>Description:</strong>
                <asp:Label ID="ImageDescriptionLabel" runat="server" Text='<%# Eval("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" Text='<%# Eval("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Uploaded by:</strong> <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />
            </td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td id="Td2" runat="server" style="">
                <a href="imageAddComments.aspx?id=<%# Eval("ImageID") %>">
                    <asp:Image ID="Image2" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>'
                        Width="300px" />
                </a>
                <br />
                Description:
                <asp:TextBox ID="ImageDescriptionTextBox" runat="server" Text='<%# Bind("ImageDescription") %>' />
                <br />
                Date Uploaded:
                <asp:TextBox ID="DateUploadedTextBox" runat="server" Text='<%# Bind("DateUploaded") %>' />
                <br />
                Time Uploaded:
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" Text='<%# Bind("TimeUploaded") %>' />
                <br />
                Uploaded by: <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                <br />
            </td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table id="Table1" runat="server" style="">
                <tr>
                    <td>
                        No data was returned.
                    </td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
            <td id="Td3" runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr id="itemPlaceholderContainer" runat="server">
                <td id="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        <InsertItemTemplate>
            <td id="Td4" runat="server" style="">
                <strong><a href="imageAddComments.aspx?id=<%# Eval("ImageID") %>"></a></strong><a
                    href="imageAddComments.aspx?id=<%# Eval("ImageID") %>">
                    <asp:Image ID="Image3" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>'
                        Width="300px" />
                </a>
                <br />
                Description:
                <asp:TextBox ID="ImageDescriptionTextBox0" runat="server" Text='<%# Bind("ImageDescription") %>' />
                <br />
                Date Uploaded:
                <asp:TextBox ID="DateUploadedTextBox0" runat="server" Text='<%# Bind("DateUploaded") %>' />
                <br />
                Time Uploaded:
                <asp:TextBox ID="TimeUploadedTextBox0" runat="server" Text='<%# Bind("TimeUploaded") %>' />
                <br />
                Uploaded by: <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                <br />
                <asp:Button ID="CancelButton0" runat="server" CommandName="Cancel" Text="Clear" />
                <br />
            </td>
        </InsertItemTemplate>
        <ItemTemplate>
            <td id="Td5" runat="server" style="">
                <strong><a href="imageAddComments.aspx?id=<%# Eval("ImageID") %>"></a></strong><a
                    href="imageAddComments.aspx?id=<%# Eval("ImageID") %>">
                    <asp:Image ID="Image4" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>'
                        Width="300px" />
                </a>
                <br />
                <strong>Description:</strong>
                <asp:Label ID="ImageDescriptionLabel0" runat="server" Text='<%# Eval("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded: </strong>
                <asp:Label ID="DateUploadedLabel0" runat="server" Text='<%# Eval("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded: </strong>
                <asp:Label ID="TimeUploadedLabel0" runat="server" Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Uploaded By: </strong><a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table id="Table2" runat="server">
                <tr id="Tr1" runat="server">
                    <td id="Td6" runat="server">
                        <table id="groupPlaceholderContainer" runat="server" border="0" style="">
                            <tr id="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr2" runat="server">
                    <td id="Td7" runat="server" style="">
                        <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
                                    ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
                                    ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td id="Td8" runat="server" style="">
                <a href="imageAddComments.aspx?id=<%# Eval("ImageID") %>">
                    <asp:Image ID="Image5" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>'
                        Width="300px" />
                </a>
                <br />
                <strong>Description:</strong>
                <asp:Label ID="ImageDescriptionLabel1" runat="server" Text='<%# Eval("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel1" runat="server" Text='<%# Eval("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel1" runat="server" Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Uploaded by:</strong>
                <br />
                <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                <br />
            </td>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT Images.ImageID, Images.ImageLink, Images.ImageDescription, Images.DateUploaded, Images.TimeUploaded, aspnet_Users.UserName FROM (Images INNER JOIN aspnet_Users ON Images.UserIDFK = aspnet_Users.UserId) ORDER BY Images.ImageID DESC">
    </asp:SqlDataSource>
</asp:Content>
